﻿create Procedure GetMappingFileByDate    
@CreatedDate varchar(250),
@TO int,
@From int  
AS    
Begin  
declare @count int  
SELECT @count=COUNT(ID) FROM FileInformation where CreatedDate between @CreatedDate+' 00:00' and @CreatedDate+' 23:59:59'    
select [Id]  
      ,[ActualFileName]  
      ,[CurrentFileName]  
      ,[FileSize]  
      ,[FileExtension]  
      ,[IsActive]  
      ,[IsDeleted]  
      ,[CreatedBy]  
      ,[CreatedDate]  
      ,[UpdatedBy]  
      ,[UpdatedDate]  
      ,[IsFolder]  
      ,[ParentId] ,Counts
      from (Select @count as Counts,Row_Number() over(order by id Desc) AS PageNumbers ,[Id]  
      ,[ActualFileName]  
      ,[CurrentFileName]  
      ,[FileSize]  
      ,[FileExtension]  
      ,[IsActive]  
      ,[IsDeleted]  
      ,[CreatedBy]  
      ,[CreatedDate]  
      ,[UpdatedBy]  
      ,[UpdatedDate]  
      ,[IsFolder]  
      ,[ParentId] from FileInformation    
where CreatedDate between @CreatedDate+' 00:00' and @CreatedDate+' 23:59:59'   )
as tt where tt.PageNumbers between @To And @From 
end  
  
  
  